Conventionally, a database system comprises a plurality of databases and a database program. Typically, prior to establishing a database system, it is required to classify data of a record to be stored as a variety of fields based on properties thereof. For example, a typical order from a manufacturer comprises fields of serial number, type, part number, unit price, etc. Such order is stored as a record in a database having fields for respectively storing the serial number, type, part number, unit price, etc. Thus, in customizing the database, it is required to define a unique attribute (such as alphabet, number, date, etc.) based on contents of data to be stored in the field as well as the length of a respective field, and input and output conditions. Subsequently to the completion of defining fields of the respective database, a database program is then able to perform input, output, or conversion on contents of data in each field of the database.
In the above conventional database system, it is also required to define properties of fields in each record of the database based on the contents of data to be stored, as best illustrated in FIG. 1. The properties usually comprise name, attribute, length, and condition. Name iserves to indicate a title (e.g., order number) of data stored in the field. Attribute serves to indicate an attribute (e.g., alphabet, number, date, etc.) of data stored in the field. Length serves to indicate a maximum bit number of input data stored in the field. Condition serves to indicate an allowable condition of input data (such as an integer smaller than 50,000 and larger than 60,000). After completing the definition of all fields, as shown in FIG. 2, it is possible to design input and output screens of each database based on each field as customized in each database. Hence, by running the database program, a user may sequentially input contents of data to be stored into each field of the corresponding database through an input screen of the database, or alternatively read and show contents of data stored in each field of the corresponding database through an output screen of the database.
In general, the database system serves to store a great number of classified records. Thus, in searching a specific record from above records or creating a relationship among various databases, it is required to select at least one field as an indexed field from each record of each database. Hence, the specific record in the database system can be searched based on the indexed field prior to showing contents of the data of that record on a screen of the database. Alternatively, it will also be possible to perform a relational search among various databases. Such an indexed field is meant to indicate a data field in a database having a tendency of creating a relationship with one of a plurality of other databases. Therefore, an indexed field possesses a unique property to prevent an incorrect search of a record related to the indexed field from occurring in a query.
As stated above, in a typical database system it is required to define a length of each field in each database in advance. After the completion of a database system, a storage space in a memory is reserved for storing a record based on the maximum allowable length of data, irrespective of whether data has been inputted or input data has a length less than the maximum allowable length in each field of every record of each database. As a result, precious memory space may be wasted since there are many fields without data stored therein or a data length less than the maximum allowable length thereof. Such drawback is especially serious in a large database system. Thus, for a current database system, it is very important to effectively utilize storage space of memory thereof for storing input data.
In recent years, with the rapid development of the Internet and numerous Web sites installed thereon, a variety of services have become available by accessing the Internet. In a typical case, a multi-national enterprise may send (or inquire about) data through the Internet to provide updated information to branches, associated manufacturers, dealers, consumer, and so on worldwide. A service or inquiry about data is also made possible on the Internet through effectively integrating a plurality of large database systems, and providing the user with desired data in a minimum period of time. Besides, it is also important for an enterprise in expanding a network to effectively utilize storage space of a memory of a database system for storing data communicated on the Internet.
Thus, it is desirable to provide a method for storing records in a database or reading the same therefrom in order to overcome the above drawbacks, such as memory wasted due to many empty data fields in the database or data length less than the maximum allowable length thereof.